var jsonObject = {
                    "mapPoints": [],
                    "length": 0
                 };

var tempElement = document.createElement("a");
tempElement.href = document.URL;
var baseurl = tempElement.protocol + "//" + tempElement.host;

var pArray = document.body.getElementsByTagName("p");
if (pArray) {
  var length = pArray.length;
  for (var i = 0; i < length ; i++) {
    var pObject = pArray.item(i);
    var aChildElements = pObject.getElementsByTagName("a");
    if (aChildElements) {
      var link = aChildElements.item(0).getAttribute("href");
      var textContent = pObject.textContent;
      jsonObject.mapPoints.push({
                                 "link": link,
                                 "title" : textContent,
                                 //"mapLocation": ""
                                });
      jsonObject.length = jsonObject.length + 1;
    } // if (aChildElements)
  } // for (var i = 0;
} // if (pArray)

if (window == top) {
  chrome.extension.onRequest.addListener(function(req, sender, sendResponse) {
    sendResponse(jsonObject);
  });
}
